//
// Created by tang on 2020/6/18.
//

#ifndef TESTREMOTE_GFX_UTILITY_HPP
#define TESTREMOTE_GFX_UTILITY_HPP

#include "base_display.hpp"

#include <string>

class GFX_Utility
{
    IPrinter *m_printer_;
    int       m_font_height_;
public:
    explicit GFX_Utility(IPrinter *printer);

    GFX_Utility& drawLine(Point2D start, Point2D end);

    GFX_Utility& drawRect(Rect2D rect);

    GFX_Utility& drawTrangle(Point2D p1, Point2D p2, Point2D p3);

    GFX_Utility& drawCircle(Point2D center, int radius);

    GFX_Utility& fillRect(Rect2D rect);

    GFX_Utility& fillTrangle(Point2D p1, Point2D p2, Point2D p3);

    GFX_Utility& fillCircle(Point2D center, int radius);

    GFX_Utility& drawText(const std::string &text, Rect2D renderArea, TextAliment aliment = Left);

    GFX_Utility& drawImage(const std::string &path, Rect2D renderArea);

    GFX_Utility& reset();

    GFX_Utility& fontSize(int height);

    void commit();

    static void loadFont(const std::string &file, int index = 0);
};

#endif //TESTREMOTE_GFX_UTILITY_HPP
